package com.jason.bookworm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jason.bookworm.dao.pojo.Book;
import com.jason.bookworm.dao.pojo.Comment;
import com.jason.bookworm.dao.pojo.User;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface CommentService extends IService<Comment> {
    //获取该本书的所有评论
    List<Comment> getAllCommOfBook(Book book);

    //分页获取该本书的评论
    List<Comment> getCommOfBookByPages(int pages,Book book);

    //获取该本书的评论条数
    Integer getCommNumOfBook(Book book);

    //获取该本书的评论页数(20条为一组)
    Integer getCalCommNum(Book book);

    //逻辑删除某条评论
    void deleteOneComm(User user,Comment comment);
}
